import time


def cal_time(name="排序时间"):

    def _cal_time(fn):

        def wrapper(*args, **kwargs):
            start = time.time()
            ret = fn(*args, **kwargs)
            end = time.time()
            delta = end - start
            print(name, delta)
            return ret
        return wrapper

    return _cal_time
